<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateComDictTypesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (!Schema::hasTable('com_dict_types'))
        {
            Schema::create('com_dict_types', function (Blueprint $table) {
                $table->string('id', 45)->primary()->comment('ID');
                $table->string('code', 45)->comment('代码');
                $table->string('name', 45)->comment('名称');
                $table->boolean('is_sys')->default(false)->comment('是否系统');
                $table->timestamps();
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('com_dict_types');
    }
}
